<template>
  <div class="content">
    <div class="title">热门精选</div>
    <div class="list">
      <template v-for="item of houseList">
        <content-item-v9 v-if="item.discoveryContentType == 9" :item-data="item.data" @click="itemClick(item.data.houseId)"></content-item-v9>
        <content-item-v3 v-if="item.discoveryContentType == 3" :item-data="item.data" @click="itemClick(item.data.houseId)"></content-item-v3>
      </template>
    </div>
  </div>
</template>

<script setup>
import useHomeStore from "@/store/modules/home";
import { storeToRefs } from "pinia";
import ContentItemV9 from "./contentItemV9.vue"
import ContentItemV3 from "./contentItemV3.vue"
import { useRouter } from "vue-router";
// import router from "@/router";

const homeStore = useHomeStore()
const {houseList} = storeToRefs(homeStore)

const router = useRouter()
const itemClick = (houseId) => {
  router.push({
    name: 'Detail',
    params: {houseId}
  })
}
</script>

<style lang="less" scoped>
.content{
  width: 100%;
  .title{
    text-align: center;
  }
  .list{
    display: flex;
    flex-wrap: wrap;
  }
}
</style>